import java.util.ArrayList;
import java.util.function.DoubleToIntFunction;

public class Test3 {
    public String solve (String s, String t) {
        // write code here
        int a=Integer.parseInt(s);
        int b=Integer.parseInt(t);
        String ret= String.valueOf(a+b);
        return ret;
    }
    private static int count;
    static Object object=new Object();
    public static void main(String[] args) throws InterruptedException {
        long beg=System.currentTimeMillis();
        Thread t1=new Thread(()->{
                for (int i = 0; i < 10000; i++) {
                    synchronized (object){count++;}
                }

        });

        Thread t2=new Thread(()->{
                for (int i = 0; i < 10000; i++) {
                    synchronized (object){count++;}
                }
        });
        t1.start();
        t2.start();
        t1.join();
        t2.join();
        System.out.println(count);
        long end=System.currentTimeMillis();
        System.out.println(end-beg);
    }
}
